<?php
/*
Template Name: Staff Team
 */
?>

<?php

//
//	get a list of all the pages who are the children of the staff team page
//

	$staff = get_pages("child_of=$post->ID&echo=0&sort_column=menu_order");

?>
<?php get_header(); ?>

<div id="content" class="page-block">

	<?php get_sidebar(); ?>

	<div id="wide">

		<div class="page" id="page-<?php echo($post->ID) ?>">

		<?php foreach($staff as $s): ?>

			<?php

			//
			//	get the staff member's photo
			//

				$img = $s->post_content;
				if(preg_match("/<img .*\/>/U", $img, $matches)) $img = $matches[0];

			//
			//	get the staff member's job title
			//

				$title = get_post_meta($s->ID, "job_title", true);

			?>

			<a href="<?php echo(get_permalink($s->ID)) ?>" class="staffmember">

				<?php echo($img) ?>

				<p class="name"><?php echo($s->post_title) ?></p>
				<p class="description"><?php echo($title) ?></p>

			</a> <!-- close .staffmember -->

		<?php endforeach; ?>

		</div> <!-- close #page -->

	</div> <!-- close #wide -->

</div> <!-- close #content -->

<?php get_footer(); ?>